<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.model.Fault"%>
<%@ page import="com.control.FaultControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
	</head>
	<body>
		<%
			request.setCharacterEncoding("UTF-8");
			String type = request.getParameter("type");
			String describe = request.getParameter("describe");
			Fault fault = new Fault();
			fault.setStu_id((Integer)session.getAttribute("user_id"));
			fault.setFault_des(describe);
			fault.setFault_type(type);
			FaultControl fc = new FaultControl();
			if(fc.insertFault(fault)) {
		%>
		<script>
			if(window.confirm("报修成功,是否继续报修！"))
				window.location.href="submit_fault.jsp";
			else
				window.location.href="faultInfo_show.jsp";
		</script>
		<%}else{ %>
			<script>
				alert("报修失败！");
				window.location.href="submit_fault.jsp";
			</script>
		<%} %>
	</body>
</html>